package org.example.booksystem.dao;

import org.example.booksystem.moudel.BookInfo;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Repository
public class BookDao {
    private List<BookInfo> list = new ArrayList<>();

    public List<BookInfo> getMockList() {
        for (int i = 1;  i < 10 ; i++) {
            BookInfo bookInfo = new BookInfo();
            bookInfo.setId(i);
            bookInfo.setBookName("book"+i);
            bookInfo.setBookAuthor("作者"+i);
            bookInfo.setBookPrice(new BigDecimal(i));
            bookInfo.setBookPublisher("出版社"+i);
            bookInfo.setBookStock(i);
            bookInfo.setBookStatus(i%3==0?2:1);
            list.add(bookInfo);
        }
        return list;
    }
}
